home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Games / NetHack 3.1.3 / source / include / global.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-08-01  |  6.3 KB  |  246 lines  |  [TEXT/R*ch]

  1. /*    SCCS Id: @(#)global.h    3.1    92/01/04    */
  2. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  3. /* NetHack may be freely redistributed.  See license for details. */
  4.  
  5. #ifndef GLOBAL_H
  6. #define GLOBAL_H
  7.  
  8. #include <stdio.h>
  9.  
  10.  
  11. /*#define BETA        /* if a beta-test copy  [MRS] */
  12.  
  13. /*
  14.  * Files expected to exist in the playground directory.
  15.  */
  16.  
  17. #define RECORD        "record"  /* a file containing list of topscorers */
  18. #define HELP        "help"      /* a file containing command descriptions */
  19. #define SHELP        "hh"        /* abbreviated form of the same */
  20. #define DEBUGHELP    "wizhelp"    /* a file containing debug mode cmds */
  21. #define RUMORFILE    "rumors"    /* a file with fortune cookies */
  22. #define ORACLEFILE    "oracles"    /* a file with oracular information */
  23. #define DATAFILE    "data"    /* a file giving the meaning of symbols used */
  24. #define CMDHELPFILE    "cmdhelp"    /* file telling what commands do */
  25. #define HISTORY        "history"    /* a file giving nethack's history */
  26. #define LICENSE        "license"    /* file with license information */
  27. #define OPTIONFILE    "opthelp"    /* a file explaining runtime options */
  28. #define OPTIONS_USED    "options"    /* compile-time options, for #version */
  29.  
  30. #define LEV_EXT    ".lev"        /* extension for special level files */
  31.  
  32.  
  33. /* Assorted definitions that may depend on selections in config.h. */
  34.  
  35. /*
  36.  * for DUMB preprocessor and compiler, e.g., cpp and pcc supplied
  37.  * with Microport SysV/AT, which have small symbol tables;
  38.  * DUMB if needed is defined in CFLAGS
  39.  */
  40. #ifdef DUMB
  41. #ifdef BITFIELDS
  42. #undef BITFIELDS
  43. #endif
  44. #ifndef STUPID
  45. #define STUPID
  46. #endif
  47. #endif    /* DUMB */
  48.  
  49. /*
  50.  * type xchar: small integers in the range 0 - 127, usually coordinates
  51.  * although they are nonnegative they must not be declared unsigned
  52.  * since otherwise comparisons with signed quantities are done incorrectly
  53.  */
  54. typedef schar    xchar;
  55. typedef xchar    boolean;        /* 0 or 1 */
  56.  
  57. #ifndef TRUE        /* defined in some systems' native include files */
  58. #define TRUE    ((boolean)1)
  59. #define FALSE    ((boolean)0)
  60. #endif
  61.  
  62. #ifndef STRNCMPI
  63. # ifndef __SASC_60        /* SAS/C already shifts to stricmp */
  64. #  define strcmpi(a,b) strncmpi((a),(b),-1)
  65. # endif
  66. #endif
  67.  
  68. /* comment out to test effects of each #define -- these will probably
  69.  * disappear eventually
  70.  */
  71. #ifdef INTERNAL_COMP
  72. # define RLECOMP    /* run-length compression of levl array - JLee */
  73. # define ZEROCOMP    /* zero-run compression of everything - Olaf Seibert */
  74. #endif
  75.  
  76. /* #define SPECIALIZATION    /* do "specialized" version of new topology */
  77.  
  78.  
  79. #ifdef BITFIELDS
  80. #define Bitfield(x,n)    unsigned x:n
  81. #else
  82. #define Bitfield(x,n)    uchar x
  83. #endif
  84.  
  85. #ifdef UNWIDENED_PROTOTYPES
  86. # define CHAR_P char
  87. # define SCHAR_P schar
  88. # define UCHAR_P uchar
  89. # define XCHAR_P xchar
  90. # define SHORT_P short
  91. # define BOOLEAN_P boolean
  92. # define ALIGNTYP_P aligntyp
  93. #else
  94. # ifdef WIDENED_PROTOTYPES
  95. #  define CHAR_P int
  96. #  define SCHAR_P int
  97. #  define UCHAR_P int
  98. #  define XCHAR_P int
  99. #  define SHORT_P int
  100. #  define BOOLEAN_P int
  101. #  define ALIGNTYP_P int
  102. # endif
  103. #endif
  104. #if defined(ULTRIX_PROTO) && !defined(__GNUC__)
  105. /* The ultrix 2.0 and 2.1 compilers (on Ultrix 4.0 and 4.2 respectively) can't
  106.  * handle "struct obj *" constructs in prototypes.  Their bugs are different,
  107.  * but both seem to work if we put "void*" in the prototype instead.  This
  108.  * gives us minimal prototype checking but avoids the compiler bugs.
  109.  *
  110.  * OBJ_P and MONST_P should _only_ be used for declaring function pointers.
  111.  */
  112. #define OBJ_P void*
  113. #define MONST_P void*
  114. #else
  115. #define OBJ_P struct obj*
  116. #define MONST_P struct monst*
  117. #endif
  118.  
  119. #define SIZE(x)    (int)(sizeof(x) / sizeof(x[0]))
  120.  
  121. typedef int winid;        /* a window identifier */
  122.  
  123. /* A limit for some NetHack int variables.  It need not, and for comparable
  124.  * scoring should not, depend on the actual limit on integers for a
  125.  * particular machine, although it is set to the minimum required maximum
  126.  * signed integer for C (2^15 -1).
  127.  */
  128. #define LARGEST_INT    32767
  129.  
  130.  
  131. #ifdef REDO
  132. #define Getchar pgetchar
  133. #endif
  134.  
  135. /*
  136.  * Automatic inclusions for the subsidiary files.
  137.  * Please don't change the order.  It does matter.
  138.  */
  139.  
  140. #ifndef COORD_H
  141. #include "coord.h"
  142. #endif
  143.  
  144. #if defined(VMS) && !defined(VMSCONF_H)
  145. # include "vmsconf.h"
  146. #endif
  147.  
  148. #if defined(UNIX) && !defined(UNIXCONF_H)
  149. # include "unixconf.h"
  150. #endif
  151.  
  152. #if defined(OS2) && !defined(OS2CONF_H)
  153. # include "os2conf.h"
  154. #endif
  155.  
  156. #if defined(MSDOS) && !defined(PCCONF_H)
  157. # include "pcconf.h"
  158. #endif
  159.  
  160. #if defined(TOS) && !defined(TOSCONF_H)
  161. # include "tosconf.h"
  162. #endif
  163.  
  164. #if defined(AMIGA) && !defined(AMICONF_H)
  165. # include "amiconf.h"
  166. #endif
  167.  
  168. #if defined(MAC) && ! defined(MACCONF_H)
  169. # include "macconf.h"
  170. #endif
  171.  
  172. #if defined(WIN32) && !defined(NTCONF_H)
  173. # include "ntconf.h"
  174. #endif
  175.  
  176. /* Displayable name of this port; don't redefine if defined in *conf.h */
  177. #ifndef PORT_ID
  178. # ifdef AMIGA
  179. #  define PORT_ID    "Amiga"
  180. # endif
  181. # ifdef MAC
  182. #  define PORT_ID    "Mac"
  183. # endif
  184. # ifdef MSDOS
  185. #  ifdef PC9801
  186. #   define PORT_ID    "PC-9801"
  187. #  else
  188. #   define PORT_ID    "PC"
  189. #  endif
  190. # endif
  191. # ifdef OS2
  192. #  define PORT_ID    "OS/2"
  193. # endif
  194. # ifdef TOS
  195. #  define PORT_ID    "ST"
  196. # endif
  197. # ifdef UNIX
  198. #  define PORT_ID    "Unix"
  199. # endif
  200. # ifdef VMS
  201. #  define PORT_ID    "VMS"
  202. # endif
  203. # ifdef WIN32CON
  204. #  define PORT_ID    "NT-Console"
  205. # endif
  206. #endif
  207.  
  208. #if defined(MICRO) && !defined(AMIGA) && !defined(TOS) && !defined(OS2_HPFS)
  209. #define SHORT_FILENAMES        /* filenames are 8.3 */
  210. #endif
  211.  
  212. /*
  213.  * Configurable internal parameters.
  214.  *
  215.  * Please be very careful if you are going to change one of these.  Any
  216.  * changes in these parameters, unless properly done, can render the
  217.  * executable inoperative.
  218.  */
  219.  
  220. /* size of terminal screen is (at least) (ROWNO+3) by COLNO */
  221. #define COLNO    80
  222. #define ROWNO    21
  223.  
  224. #define MAXNROFROOMS    20    /* max number of rooms per level */
  225. #define MAX_SUBROOMS    16    /* max # of subrooms in a given room */
  226. #define DOORMAX        120    /* max number of doors per level */
  227.  
  228. #define BUFSZ        256    /* for getlin buffers */
  229. #define QBUFSZ        128    /* for building question text */
  230.  
  231. #define PL_NSIZ        32    /* name of player, ghost, shopkeeper */
  232. #define PL_CSIZ        20    /* sizeof pl_character */
  233. #define PL_FSIZ        32    /* fruit name */
  234.  
  235. #define MAXDUNGEON    10    /* current maximum number of dungeons */
  236. #define MAXLEVEL    30    /* max number of levels in one dungeon */
  237. #define MAXSTAIRS    1    /* max # of special stairways in a dungeon */
  238. #define ALIGNWEIGHT    4    /* generation weight of alignment */
  239.  
  240. #define MAXULEV        30    /* max character experience level */
  241.  
  242. #define MAXMONNO    120    /* geno monst after this number killed */
  243. #define MHPMAX        500    /* maximum monster hp */
  244.  
  245. #endif /* GLOBAL_H */
  246.